While

Runs a block of statements as long as a condition is True or until an Exit While statement runs.

During playback, the While statement condition is evaluated at the beginning of the loop. If the condition is True, statements in the loop run. If the condition is False, statements in the loop do not run and playback continues with the first statement outside the block.

Note: Do...Loop Until and Do...Loop While statements provide a more structured and flexible way to perform loops.

Syntax

While Condition

[Statements]

WEnd

Arguments

Argument Description
Condition String or numeric expression to evaluate.
Statements One or more statements to run while Condition is True.

Keyword View notes

The condition to evaluate is displayed in the Information column.

Example

While counter <= type

Window("Feedback").EditBox("editboxFirst").TypeText("Jane")

Window("Feedback").EditBox("editboxLast").TypeText("Smith")

Window("Feedback").ComboBox("comboboxType").Item(counter).Select()

Window("Feedback").Button("buttonSend").Click()

Window("Browser").Navigate("http://www.wysicorp.com/reportbug.php")

counter = counter + 1

WEnd

Window("Browser").Close()